package http_servlet_request;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Creared with IntelliJ IDEA.
 * Description:
 * User:yxd
 * Date:2022-05-29
 * Time:18:56
 */
@WebServlet("/message")
public class Test1 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //构造形如/message?aa=10&bb=20的请求
        String a = req.getParameter("aa");
        String b = req.getParameter("bb");
        resp.getWriter().write("aa=" + a + ",bb=" + b);
    }
}
